package com.ch.roomdemo

import androidx.lifecycle.LiveData

class PensionRepository {

    private var pensionDao: PensionDao = MyDataBase.sin.getPensionDao()


    fun insertPension(vararg pension: Pension) {
        pensionDao.insertPension(*pension)
    }


    fun deletePension(vararg pension: Pension) {
        pensionDao.deletePension(*pension)
    }

    fun updatePension(vararg pension: Pension) {
        pensionDao.updatePension(*pension)
    }

    fun getAllPension(): LiveData<List<Pension>> {
        return pensionDao.getAllPension()
    }

    fun getPensionById(perSionId: Int): Pension {
        return pensionDao.getPensionById(perSionId)
    }

    fun deleteAllPension() {
        pensionDao.deleteAllPension()
    }
}